package com.senjoeson.androidtv.securitydemo;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    private static final String TAG ="ExampleInstrumentedTest" ;

    @Test
    public void useAppContext() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.senjoeson.androidtv.securitydemo", appContext.getPackageName());

        String base64Encode = AesUtils.base64Encode("我是一个中国人");
        Log.d(TAG, "base64Encode: "+base64Encode);

        String base64Decode = AesUtils.base64Decode(base64Encode);

        Log.d(TAG, "base64Decode: "+base64Decode);


        long nanoTime = System.nanoTime();
        FileUtils.readFile("H:\\SecurityCheckPlugin\\plugin.xml");
        Log.d(TAG, "useAppContext11111: "+(System.nanoTime()-nanoTime));

        long nanoTime1 = System.nanoTime();
        AesUtils.readFile("H:\\SecurityCheckPlugin\\plugin.xml");
        // System.out.println(new String(bytes));
        Log.d(TAG, "useAppContext222222: "+(System.nanoTime()-nanoTime1));
    }
}
